package com.views {
	import com.MapStatic;
	import com.views.interfaces.map.IMapInstance;

	import flash.display.Sprite;
	import flash.system.Capabilities;

	public class ScreenView extends Base implements IView {
		private var _screen:Sprite;
		private var _currentMap:Object;

		public function ScreenView() {
			this._screen = new Sprite();
			super();
		}

		public function show():void {
			this.render();
		}

		public function close():void {

		}

		public function clear():void {

		}

		public function get currentMap():Object {
			return this._currentMap;
		}

		public function get display():Sprite {
			return (this._screen);
		}

		public function stopPlayerRun():void {
			if (this._currentMap) {
				this._currentMap.stopPlayerRun();
			}
			;
		}

		/**
		 * 当前方法进行清理
		 */
		public function set currentMap(_arg1:Object):void {
			if (this._currentMap) {
				this._currentMap.clear();
			}
			this._currentMap = _arg1;
			this._screen.addChildAt(this._currentMap.content, 0);
		}

		private function render():void {
			_view.structure.content.addChild(this._screen);
			_view.toolbar.init();
			this._screen.addChild(_view.toolbar.content);
			if (Capabilities.isDebugger) {
				_view.structure.debugLayer.addChild(new FPS());
			}
			this.initMap();
		}

		private function initMap():void {
			
//			MapStatic.mapInstance = _view.getAssetsObj("Map").loader.content as IMapInstance;
		}
	}
}
